import Vue from 'vue'
import Router from 'vue-router'
import Home from "../components/Home";
import User from "../components/User";
import Student from "../components/Student";
import UserAdd from "../components/UserAdd";
import Useredit from "../components/Useredit";

Vue.use(Router)

export default new Router({
  routes: [
    {path: '/', redirect:'/home'},
    {path:'/home', component:Home},
    {path: '/user', name:'User', component: User,
      children:[
        {path:'add', component:UserAdd},//子路由，子路由不需要使用斜杠
        {path: 'edit', component: Useredit}
      ]
    },
    {path:'/student', component:Student},


  ]
})
